#include "pe_det.h"

#include "drv_gpio.h"
#include "pin.h"

#define PE_D_H_MCU  GET_PIN(G, 12)
#define PE_D_L_MCU  GET_PIN(D, 9)

/**
 * @brief  PE端口初始化
 * @return int 
 */
int pe_det_init(void)
{
    int ret = 0;
    rt_pin_mode(PE_D_H_MCU, PIN_MODE_INPUT_PULLDOWN);
    rt_pin_mode(PE_D_L_MCU, PIN_MODE_INPUT_PULLDOWN);
    return ret;
}
INIT_APP_EXPORT(pe_det_init);

/**
 * @brief Get the pe state object
 * @return int 
 */
int get_pe_state(void) {
    int ret = 0;

    if (rt_pin_read(PE_D_H_MCU) || rt_pin_read(PE_D_L_MCU))
    {
        ret = -1;
    }
    return ret;
}



